/**
 * Copyright &copy; 2016-2017 <a href="http://git.oschina.net/whoamien/backend_management">Backend Management</a> All rights reserved.
 */
package com.xw.framework.vo;

import java.io.Serializable;
import java.util.List;

import com.google.common.collect.Lists;
import com.xw.util.JsonUtil;

/**
 * The Class UserMenu.
 *
 * @author Xi Wei
 */
public class UserMenu implements Serializable {

	private Long id;
	private String menuCode;
	private String menuName;
	private int menuLevel = 1;	
	private String menuUrl;
	private String menuIcon;
	private int menuOrder = 1;
	private int menuType = 1;
	private Long parentId;
	private boolean hasParent = false;
	
	private List<UserMenu> subMenuList = Lists.newArrayList();
	
	
	/**
	 * Gets the id.
	 *
	 * @return the id
	 */
	public Long getId() {
		return id;
	}
	
	/**
	 * Sets the id.
	 *
	 * @param id the new id
	 */
	public void setId(Long id) {
		this.id = id;
	}
	
	/**
	 * Gets the menu code.
	 *
	 * @return the menu code
	 */
	public String getMenuCode() {
		return menuCode;
	}
	
	/**
	 * Sets the menu code.
	 *
	 * @param menuCode the new menu code
	 */
	public void setMenuCode(String menuCode) {
		this.menuCode = menuCode;
	}
	
	/**
	 * Gets the menu name.
	 *
	 * @return the menu name
	 */
	public String getMenuName() {
		return menuName;
	}
	
	/**
	 * Sets the menu name.
	 *
	 * @param menuName the new menu name
	 */
	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}
	
	/**
	 * Gets the menu level.
	 *
	 * @return the menu level
	 */
	public int getMenuLevel() {
		return menuLevel;
	}
	
	/**
	 * Sets the menu level.
	 *
	 * @param menuLevel the new menu level
	 */
	public void setMenuLevel(int menuLevel) {
		this.menuLevel = menuLevel;
	}
	
	/**
	 * Gets the menu url.
	 *
	 * @return the menu url
	 */
	public String getMenuUrl() {
		return menuUrl;
	}
	
	/**
	 * Sets the menu url.
	 *
	 * @param menuUrl the new menu url
	 */
	public void setMenuUrl(String menuUrl) {
		this.menuUrl = menuUrl;
	}
	
	/**
	 * Gets the menu icon.
	 *
	 * @return the menu icon
	 */
	public String getMenuIcon() {
		return menuIcon;
	}
	
	/**
	 * Sets the menu icon.
	 *
	 * @param menuIcon the new menu icon
	 */
	public void setMenuIcon(String menuIcon) {
		this.menuIcon = menuIcon;
	}
	
	/**
	 * Gets the menu order.
	 *
	 * @return the menu order
	 */
	public int getMenuOrder() {
		return menuOrder;
	}
	
	/**
	 * Sets the menu order.
	 *
	 * @param menuOrder the new menu order
	 */
	public void setMenuOrder(int menuOrder) {
		this.menuOrder = menuOrder;
	}
	
	/**
	 * Gets the menu type.
	 *
	 * @return the menu type
	 */
	public int getMenuType() {
		return menuType;
	}
	
	/**
	 * Sets the menu type.
	 *
	 * @param menuType the new menu type
	 */
	public void setMenuType(int menuType) {
		this.menuType = menuType;
	}
	
	/**
	 * Gets the sub menu list.
	 *
	 * @return the sub menu list
	 */
	public List<UserMenu> getSubMenuList() {
		return subMenuList;
	}
	
	/**
	 * Sets the sub menu list.
	 *
	 * @param subMenuList the new sub menu list
	 */
	public void setSubMenuList(List<UserMenu> subMenuList) {
		this.subMenuList = subMenuList;
	}
	
	/**
	 * Checks if is checks for parent.
	 *
	 * @return true, if is checks for parent
	 */
	public boolean isHasParent() {
		return hasParent;
	}
	
	/**
	 * Sets the checks for parent.
	 *
	 * @param hasParent the new checks for parent
	 */
	public void setHasParent(boolean hasParent) {
		this.hasParent = hasParent;
	}
	
	/**
	 * Gets the parent id.
	 *
	 * @return the parent id
	 */
	public Long getParentId() {
		return parentId;
	}
	
	/**
	 * Sets the parent id.
	 *
	 * @param parentId the new parent id
	 */
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
	
	/**
	 * Checks if is checks for sub menu.
	 *
	 * @return true, if is checks for sub menu
	 */
	public boolean isHasSubMenu(){
		return subMenuList.size() == 0? false:true;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return JsonUtil.beanToJson(this);
	}
	
	
}
